/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.comeval.modelo;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author LUISA
 */
@Entity
@Table(name = "laboratorio")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Laboratorio.findAll", query = "SELECT l FROM Laboratorio l"),
    @NamedQuery(name = "Laboratorio.findByNitlaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.nitlaboratorio = :nitlaboratorio"),
    @NamedQuery(name = "Laboratorio.findByNombrelaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.nombrelaboratorio = :nombrelaboratorio"),
    @NamedQuery(name = "Laboratorio.findByUbicacionlaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.ubicacionlaboratorio = :ubicacionlaboratorio"),
    @NamedQuery(name = "Laboratorio.findByTelefonolaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.telefonolaboratorio = :telefonolaboratorio"),
    @NamedQuery(name = "Laboratorio.findByCorreolaboratorio", query = "SELECT l FROM Laboratorio l WHERE l.correolaboratorio = :correolaboratorio")})
public class Laboratorio implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nitlaboratorio")
    private String nitlaboratorio;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 200)
    @Column(name = "nombrelaboratorio")
    private String nombrelaboratorio;
    @Size(max = 200)
    @Column(name = "ubicacionlaboratorio")
    private String ubicacionlaboratorio;
    @Basic(optional = false)
    @NotNull
    @Column(name = "telefonolaboratorio")
    private int telefonolaboratorio;
    @Size(max = 100)
    @Column(name = "correolaboratorio")
    private String correolaboratorio;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "laboratorioentrada")
    private Collection<Entrada> entradaCollection;

    public Laboratorio() {
    }

    public Laboratorio(String nitlaboratorio) {
        this.nitlaboratorio = nitlaboratorio;
    }

    public Laboratorio(String nitlaboratorio, String nombrelaboratorio, int telefonolaboratorio) {
        this.nitlaboratorio = nitlaboratorio;
        this.nombrelaboratorio = nombrelaboratorio;
        this.telefonolaboratorio = telefonolaboratorio;
    }

    public String getNitlaboratorio() {
        return nitlaboratorio;
    }

    public void setNitlaboratorio(String nitlaboratorio) {
        this.nitlaboratorio = nitlaboratorio;
    }

    public String getNombrelaboratorio() {
        return nombrelaboratorio;
    }

    public void setNombrelaboratorio(String nombrelaboratorio) {
        this.nombrelaboratorio = nombrelaboratorio;
    }

    public String getUbicacionlaboratorio() {
        return ubicacionlaboratorio;
    }

    public void setUbicacionlaboratorio(String ubicacionlaboratorio) {
        this.ubicacionlaboratorio = ubicacionlaboratorio;
    }

    public int getTelefonolaboratorio() {
        return telefonolaboratorio;
    }

    public void setTelefonolaboratorio(int telefonolaboratorio) {
        this.telefonolaboratorio = telefonolaboratorio;
    }

    public String getCorreolaboratorio() {
        return correolaboratorio;
    }

    public void setCorreolaboratorio(String correolaboratorio) {
        this.correolaboratorio = correolaboratorio;
    }

    @XmlTransient
    public Collection<Entrada> getEntradaCollection() {
        return entradaCollection;
    }

    public void setEntradaCollection(Collection<Entrada> entradaCollection) {
        this.entradaCollection = entradaCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nitlaboratorio != null ? nitlaboratorio.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Laboratorio)) {
            return false;
        }
        Laboratorio other = (Laboratorio) object;
        if ((this.nitlaboratorio == null && other.nitlaboratorio != null) || (this.nitlaboratorio != null && !this.nitlaboratorio.equals(other.nitlaboratorio))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.comeval.modelo.Laboratorio[ nitlaboratorio=" + nitlaboratorio + " ]";
    }
    
}
